package infostroy.bookagolf.components.table;

import javax.swing.*;
import javax.swing.border.EmptyBorder;
import javax.swing.table.DefaultTableCellRenderer;
import java.awt.*;

/**
 * Created by Andrew on 18.02.14.
 */
public class GolfTableCellStringRenderer extends DefaultTableCellRenderer {
    @Override
    public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
        JLabel label = (JLabel) super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
        label.setHorizontalAlignment(JLabel.LEFT);
        if (column == 0) {
            label.setBorder(new EmptyBorder(0, 20, 0, 0));
        }
        return label;
    }
}
